import React, { Component } from 'react'
import PropTypes from 'prop-types'
import right from 'images/index/weather/right.png'
import left from 'images/index/weather/left.png'

class Trigger extends Component {
  render() {
    return (
      <div className='trigger'>
        <div className='trigger-content' onClick={() => this.props.onClick(!this.props.collapsed)}>
          <img src={this.props.collapsed ? left: right} alt=""/>
        </div>
      </div>
    )
  }
}

Trigger.propTypes = {
  collapsed: PropTypes.bool,
  onClick: PropTypes.func
}

export default Trigger